<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDriverWalletTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('driver_withdraw_wallet', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('driver_id')->index()->comment('司机ID');
            $table->enum('type', [1, 2, 3])->default(1)->comment('账号类型:1-支付宝，2-微信，3-银行卡');
            $table->string('account', 50)->comment('账号');
            $table->string('bank_name', 50)->nullable()->comment('银行名称');
            $table->string('account_name', 20)->nullable()->comment('开户姓名');
            $table->char('phone', 11)->nullable()->comment('预留手机号');
            $table->timestamps();
            $table->softDeletes();
        });
        \DB::statement("ALTER TABLE `driver_withdraw_wallet` comment '司机提现账号表'");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('driver_withdraw_wallet');
    }
}
